<!DOCTYPE html>
<html>
<head>
  <title>会员管理 - 随访系统</title>
  {include file="public/head" /}
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

  {include file="public/nav" /}
  {include file="public/menu" /}

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        会员管理
        <small>会员列表</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 控制台</a></li>
        <li class="active">会员管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">
      <div class="row" >
        <div class="col-xs-12">
          <!-- form start -->
            <form action="{:url('User/index')}" class="form-horizontal" style="background: #fff">
              <div class="box-body">
              <div class="row">
                <div class="col-xs-4">
                  <div class="form-group">
                     <label for="inputPassword3" class="col-sm-2 control-label">关键字</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="q" placeholder="可输入病案号/账号/手机号">
                    </div>
                  </div>
                </div>
                <div class="col-xs-4">
                  <div class="form-group">
                     <label for="inputPassword3" class="col-sm-3 control-label">用户状态</label>
                    <div class="col-sm-9">
                      <select name="status" class="form-control">
                      <option value="0">全部</option>
                      <option value="1">正常</option>
                      <option value="2">禁用</option>
                    </select>
                    </div>
                  </div>
                </div>
                <div class="col-xs-4">
                  <button type="submit" class="btn btn-info">搜索</button>
                </div>
              </div>
              </div>
            </form> 
            <!-- /.box-header -->
          <div class="box">
            <div class="box-body">
              <table id="example1" class="table table-bordered table-striped">
                <thead>
                <tr>
                  <th style=" width: 120px;">操作</th>
                  <th>账号</th>
                  <th>手机号</th>
                  <th>病案号</th>
                  
                 
                  <th>最后登录时间</th> <th>创建时间</th><th>状态</th>
                 
                </tr>
                </thead>
                <tbody>
                {foreach name="list" item="vo"}
               
                <tr>
                  <td>
                   <small class="btn btn-danger btn-xs del_user" data-id="{$vo.uid}"><i class="fa fa-clock-o"></i> 删除</small>
                  </td> 
                  <td>{$vo.uname}</td>
                  <td>{$vo.phone}</td>
                  <td>{$vo.patient_code}</td>
                 <td>{$vo.last_time|date="Y-m-d H:i:s",###}</td>
                 <td>{$vo.ctime|date="Y-m-d H:i:s",###}</td>
                 <td>{$user_status[$vo.status]}</td>
                  </tr>
                {/foreach}
                </tbody>
              </table>
              <div class="pull-right">{$page}</div>
            </div>
            <!-- /.box-body -->
           
          </div>
          <!-- /.box -->

        </div>
      </div>
    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  {include file="public/foot" /}
</div>
<!-- ./wrapper -->
{include file="public/js" /}
<script type="text/javascript">
  //调用layui 插件
  layui.use('layer', function(){
    //删除联系人
    $('.del_patient').click(function () {
      var patient_id = $(this).attr('data-id');
      layer.confirm('此操作不可逆，是否继续操作？', {
        btn: ['确定','取消'] //按钮
      }, function(){
        $.post("{:url('Patient/doDel')}", {patient_id:patient_id},function(res){
                if (res.status==1){
                  layer.msg(res.msg,{time: 500},function(index, layero){
                    location.reload();
                  });
                  return false;
                }else{
                  layer.msg(res.msg,{time: 500});
                  return false;
                }
           }, "json");
      }, function(){
        layer.msg('已取消操作', {
          time: 500,});   
      });
    });
});
</script>
</body>
</html>